<template>
  <view class="nav-bar">
    <uni-nav-bar
      left-icon="back"
      :left-text="leftText"
      :title="title"
      :statusBar="true"
      @clickLeft="goBack"
    ></uni-nav-bar>
  </view>
</template>

<script>
export default {
  name: "nav-bar",
  props: {
    leftText: {
      type: String,
      default: "返回",
    },
    title: {
      type: String,
      default: "",
    },
  },
  setup() {
    const goBack = () => {
      uni.navigateBack({
        delta: 1,
        animationType: "slide-out-left",
        animationDuration: 100,
      });
    };
    return {
      goBack,
    };
  },
};
</script>
<style lang="scss" scoped>
.nav-bar {
  width: 100%;
  ::v-deep .uni-navbar__header {
    > .uni-navbar__header-btns.uni-navbar__header-btns-left {
      width: auto !important;
    }
  }
  ::v-deep .uniui-back {
    font-size: 50rpx!important;
  }
  ::v-deep .uni-navbar-btn-text{
    uni-text{
      font-size: 30rpx!important;
    }
  }
}
</style>
